<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 解码字母到整数映射 -->
    <script>
      var freqAlphabets = function (s) {
        const data = new Map()
        for (let i = 1; i < 27; i++) {
          data.set(i > 9 ? `${i}#` : `${i}`, String.fromCharCode(96 + i))
        }
        const result = []
        for (let i = 0; i < s.length; i++) {
          if (s.charAt(i + 2) === '#') {
            result.push(data.get(s.slice(i, i + 3)))
            i += 2
          } else {
            result.push(data.get(s.charAt(i)))
          }
        }

        return result.join('')
      }
      console.log(freqAlphabets('10#11#12'))
    </script>
  </body>
</html>
